using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
    public class SALFLDGInfo
    {
		#region Local Variable
		private String _ACCNT_CODE;
		public String ACCNT_CODE
		{
			get { return _ACCNT_CODE; }
			set { _ACCNT_CODE = value; }
		}
		private Int32 _PERIOD;
		public Int32 PERIOD
		{
			get { return _PERIOD; }
			set { _PERIOD = value; }
		}
		private Int32 _TRANS_DATE;
		public Int32 TRANS_DATE
		{
			get { return _TRANS_DATE; }
			set { _TRANS_DATE = value; }
		}
		private Int32 _JRNAL_NO;
		public Int32 JRNAL_NO
		{
			get { return _JRNAL_NO; }
			set { _JRNAL_NO = value; }
		}
		private Int32 _JRNAL_LINE;
		public Int32 JRNAL_LINE
		{
			get { return _JRNAL_LINE; }
			set { _JRNAL_LINE = value; }
		}
		private Decimal _AMOUNT;
		public Decimal AMOUNT
		{
			get { return _AMOUNT; }
			set { _AMOUNT = value; }
		}
		private String _D_C;
		public String D_C
		{
			get { return _D_C; }
			set { _D_C = value; }
		}
		private String _ALLOCATION;
		public String ALLOCATION
		{
			get { return _ALLOCATION; }
			set { _ALLOCATION = value; }
		}
		private String _JRNAL_TYPE;
		public String JRNAL_TYPE
		{
			get { return _JRNAL_TYPE; }
			set { _JRNAL_TYPE = value; }
		}
		private String _JRNAL_SRCE;
		public String JRNAL_SRCE
		{
			get { return _JRNAL_SRCE; }
			set { _JRNAL_SRCE = value; }
		}
		private String _TREFERENCE;
		public String TREFERENCE
		{
			get { return _TREFERENCE; }
			set { _TREFERENCE = value; }
		}
		private String _DESCRIPTN;
		public String DESCRIPTN
		{
			get { return _DESCRIPTN; }
			set { _DESCRIPTN = value; }
		}
		private Int32 _ENTRY_DATE;
		public Int32 ENTRY_DATE
		{
			get { return _ENTRY_DATE; }
			set { _ENTRY_DATE = value; }
		}
		private Int32 _ENTRY_PRD;
		public Int32 ENTRY_PRD
		{
			get { return _ENTRY_PRD; }
			set { _ENTRY_PRD = value; }
		}
		private Int32 _DUE_DATE;
		public Int32 DUE_DATE
		{
			get { return _DUE_DATE; }
			set { _DUE_DATE = value; }
		}
		private Int32 _ALLOC_REF;
		public Int32 ALLOC_REF
		{
			get { return _ALLOC_REF; }
			set { _ALLOC_REF = value; }
		}
		private Int32 _ALLOC_DATE;
		public Int32 ALLOC_DATE
		{
			get { return _ALLOC_DATE; }
			set { _ALLOC_DATE = value; }
		}
		private Int32 _ALLOC_PERIOD;
		public Int32 ALLOC_PERIOD
		{
			get { return _ALLOC_PERIOD; }
			set { _ALLOC_PERIOD = value; }
		}
		private String _ASSET_IND;
		public String ASSET_IND
		{
			get { return _ASSET_IND; }
			set { _ASSET_IND = value; }
		}
		private String _ASSET_CODE;
		public String ASSET_CODE
		{
			get { return _ASSET_CODE; }
			set { _ASSET_CODE = value; }
		}
		private String _ASSET_SUB;
		public String ASSET_SUB
		{
			get { return _ASSET_SUB; }
			set { _ASSET_SUB = value; }
		}
		private String _CONV_CODE;
		public String CONV_CODE
		{
			get { return _CONV_CODE; }
			set { _CONV_CODE = value; }
		}
		private Decimal _CONV_RATE;
		public Decimal CONV_RATE
		{
			get { return _CONV_RATE; }
			set { _CONV_RATE = value; }
		}
		private Decimal _OTHER_AMT;
		public Decimal OTHER_AMT
		{
			get { return _OTHER_AMT; }
			set { _OTHER_AMT = value; }
		}
		private String _OTHER_DP;
		public String OTHER_DP
		{
			get { return _OTHER_DP; }
			set { _OTHER_DP = value; }
		}
		private String _CLEARDOWN;
		public String CLEARDOWN
		{
			get { return _CLEARDOWN; }
			set { _CLEARDOWN = value; }
		}
		private String _REVERSAL;
		public String REVERSAL
		{
			get { return _REVERSAL; }
			set { _REVERSAL = value; }
		}
		private String _LOSS_GAIN;
		public String LOSS_GAIN
		{
			get { return _LOSS_GAIN; }
			set { _LOSS_GAIN = value; }
		}
		private String _ROUGH_FLAG;
		public String ROUGH_FLAG
		{
			get { return _ROUGH_FLAG; }
			set { _ROUGH_FLAG = value; }
		}
		private String _IN_USE_FLAG;
		public String IN_USE_FLAG
		{
			get { return _IN_USE_FLAG; }
			set { _IN_USE_FLAG = value; }
		}
		private String _ANAL_T0;
		public String ANAL_T0
		{
			get { return _ANAL_T0; }
			set { _ANAL_T0 = value; }
		}
		private String _ANAL_T1;
		public String ANAL_T1
		{
			get { return _ANAL_T1; }
			set { _ANAL_T1 = value; }
		}
		private String _ANAL_T2;
		public String ANAL_T2
		{
			get { return _ANAL_T2; }
			set { _ANAL_T2 = value; }
		}
		private String _ANAL_T3;
		public String ANAL_T3
		{
			get { return _ANAL_T3; }
			set { _ANAL_T3 = value; }
		}
		private String _ANAL_T4;
		public String ANAL_T4
		{
			get { return _ANAL_T4; }
			set { _ANAL_T4 = value; }
		}
		private String _ANAL_T5;
		public String ANAL_T5
		{
			get { return _ANAL_T5; }
			set { _ANAL_T5 = value; }
		}
		private String _ANAL_T6;
		public String ANAL_T6
		{
			get { return _ANAL_T6; }
			set { _ANAL_T6 = value; }
		}
		private String _ANAL_T7;
		public String ANAL_T7
		{
			get { return _ANAL_T7; }
			set { _ANAL_T7 = value; }
		}
		private String _ANAL_T8;
		public String ANAL_T8
		{
			get { return _ANAL_T8; }
			set { _ANAL_T8 = value; }
		}
		private String _ANAL_T9;
		public String ANAL_T9
		{
			get { return _ANAL_T9; }
			set { _ANAL_T9 = value; }
		}
		private Int32 _POSTING_DATE;
		public Int32 POSTING_DATE
		{
			get { return _POSTING_DATE; }
			set { _POSTING_DATE = value; }
		}
		private String _ALLOC_IN_PROGRESS;
		public String ALLOC_IN_PROGRESS
		{
			get { return _ALLOC_IN_PROGRESS; }
			set { _ALLOC_IN_PROGRESS = value; }
		}
		private Int32 _HOLD_REF;
		public Int32 HOLD_REF
		{
			get { return _HOLD_REF; }
			set { _HOLD_REF = value; }
		}
		private String _HOLD_OP_ID;
		public String HOLD_OP_ID
		{
			get { return _HOLD_OP_ID; }
			set { _HOLD_OP_ID = value; }
		}
        #endregion LocalVariable
        
        #region Constructor
		public SALFLDGInfo()
		{
			_ACCNT_CODE = "";
			_PERIOD = -1;
			_TRANS_DATE = -1;
			_JRNAL_NO = -1;
			_JRNAL_LINE = -1;
			_AMOUNT = 0;
			_D_C = "";
			_ALLOCATION = "";
			_JRNAL_TYPE = "";
			_JRNAL_SRCE = "";
			_TREFERENCE = "";
			_DESCRIPTN = "";
			_ENTRY_DATE = -1;
			_ENTRY_PRD = -1;
			_DUE_DATE = -1;
			_ALLOC_REF = -1;
			_ALLOC_DATE = -1;
			_ALLOC_PERIOD = -1;
			_ASSET_IND = "";
			_ASSET_CODE = "";
			_ASSET_SUB = "";
			_CONV_CODE = "";
			_CONV_RATE = 0;
			_OTHER_AMT = 0;
			_OTHER_DP = "";
			_CLEARDOWN = "";
			_REVERSAL = "";
			_LOSS_GAIN = "";
			_ROUGH_FLAG = "";
			_IN_USE_FLAG = "";
			_ANAL_T0 = "";
			_ANAL_T1 = "";
			_ANAL_T2 = "";
			_ANAL_T3 = "";
			_ANAL_T4 = "";
			_ANAL_T5 = "";
			_ANAL_T6 = "";
			_ANAL_T7 = "";
			_ANAL_T8 = "";
			_ANAL_T9 = "";
			_POSTING_DATE = -1;
			_ALLOC_IN_PROGRESS = "";
			_HOLD_REF = -1;
			_HOLD_OP_ID = "";
		}
		public SALFLDGInfo(
			String ACCNT_CODE,
			Int32 PERIOD,
			Int32 TRANS_DATE,
			Int32 JRNAL_NO,
			Int32 JRNAL_LINE,
			Decimal AMOUNT,
			String D_C,
			String ALLOCATION,
			String JRNAL_TYPE,
			String JRNAL_SRCE,
			String TREFERENCE,
			String DESCRIPTN,
			Int32 ENTRY_DATE,
			Int32 ENTRY_PRD,
			Int32 DUE_DATE,
			Int32 ALLOC_REF,
			Int32 ALLOC_DATE,
			Int32 ALLOC_PERIOD,
			String ASSET_IND,
			String ASSET_CODE,
			String ASSET_SUB,
			String CONV_CODE,
			Decimal CONV_RATE,
			Decimal OTHER_AMT,
			String OTHER_DP,
			String CLEARDOWN,
			String REVERSAL,
			String LOSS_GAIN,
			String ROUGH_FLAG,
			String IN_USE_FLAG,
			String ANAL_T0,
			String ANAL_T1,
			String ANAL_T2,
			String ANAL_T3,
			String ANAL_T4,
			String ANAL_T5,
			String ANAL_T6,
			String ANAL_T7,
			String ANAL_T8,
			String ANAL_T9,
			Int32 POSTING_DATE,
			String ALLOC_IN_PROGRESS,
			Int32 HOLD_REF,
			String HOLD_OP_ID
			)
		{
			_ACCNT_CODE = ACCNT_CODE;
			_PERIOD = PERIOD;
			_TRANS_DATE = TRANS_DATE;
			_JRNAL_NO = JRNAL_NO;
			_JRNAL_LINE = JRNAL_LINE;
			_AMOUNT = AMOUNT;
			_D_C = D_C;
			_ALLOCATION = ALLOCATION;
			_JRNAL_TYPE = JRNAL_TYPE;
			_JRNAL_SRCE = JRNAL_SRCE;
			_TREFERENCE = TREFERENCE;
			_DESCRIPTN = DESCRIPTN;
			_ENTRY_DATE = ENTRY_DATE;
			_ENTRY_PRD = ENTRY_PRD;
			_DUE_DATE = DUE_DATE;
			_ALLOC_REF = ALLOC_REF;
			_ALLOC_DATE = ALLOC_DATE;
			_ALLOC_PERIOD = ALLOC_PERIOD;
			_ASSET_IND = ASSET_IND;
			_ASSET_CODE = ASSET_CODE;
			_ASSET_SUB = ASSET_SUB;
			_CONV_CODE = CONV_CODE;
			_CONV_RATE = CONV_RATE;
			_OTHER_AMT = OTHER_AMT;
			_OTHER_DP = OTHER_DP;
			_CLEARDOWN = CLEARDOWN;
			_REVERSAL = REVERSAL;
			_LOSS_GAIN = LOSS_GAIN;
			_ROUGH_FLAG = ROUGH_FLAG;
			_IN_USE_FLAG = IN_USE_FLAG;
			_ANAL_T0 = ANAL_T0;
			_ANAL_T1 = ANAL_T1;
			_ANAL_T2 = ANAL_T2;
			_ANAL_T3 = ANAL_T3;
			_ANAL_T4 = ANAL_T4;
			_ANAL_T5 = ANAL_T5;
			_ANAL_T6 = ANAL_T6;
			_ANAL_T7 = ANAL_T7;
			_ANAL_T8 = ANAL_T8;
			_ANAL_T9 = ANAL_T9;
			_POSTING_DATE = POSTING_DATE;
			_ALLOC_IN_PROGRESS = ALLOC_IN_PROGRESS;
			_HOLD_REF = HOLD_REF;
			_HOLD_OP_ID = HOLD_OP_ID;
		}
		public SALFLDGInfo(DataRow dr)
		{
			if (dr != null)
			{
				_ACCNT_CODE = dr["ACCNT_CODE"] == DBNull.Value ? "" : (String)dr["ACCNT_CODE"];
				_PERIOD = dr["PERIOD"] == DBNull.Value ? -1 : (Int32)dr["PERIOD"];
				_TRANS_DATE = dr["TRANS_DATE"] == DBNull.Value ? -1 : (Int32)dr["TRANS_DATE"];
				_JRNAL_NO = dr["JRNAL_NO"] == DBNull.Value ? -1 : (Int32)dr["JRNAL_NO"];
				_JRNAL_LINE = dr["JRNAL_LINE"] == DBNull.Value ? -1 : (Int32)dr["JRNAL_LINE"];
				_AMOUNT = dr["AMOUNT"] == DBNull.Value ? 0 : (Decimal)dr["AMOUNT"];
				_D_C = dr["D_C"] == DBNull.Value ? "" : (String)dr["D_C"];
				_ALLOCATION = dr["ALLOCATION"] == DBNull.Value ? "" : (String)dr["ALLOCATION"];
				_JRNAL_TYPE = dr["JRNAL_TYPE"] == DBNull.Value ? "" : (String)dr["JRNAL_TYPE"];
				_JRNAL_SRCE = dr["JRNAL_SRCE"] == DBNull.Value ? "" : (String)dr["JRNAL_SRCE"];
				_TREFERENCE = dr["TREFERENCE"] == DBNull.Value ? "" : (String)dr["TREFERENCE"];
				_DESCRIPTN = dr["DESCRIPTN"] == DBNull.Value ? "" : (String)dr["DESCRIPTN"];
				_ENTRY_DATE = dr["ENTRY_DATE"] == DBNull.Value ? -1 : (Int32)dr["ENTRY_DATE"];
				_ENTRY_PRD = dr["ENTRY_PRD"] == DBNull.Value ? -1 : (Int32)dr["ENTRY_PRD"];
				_DUE_DATE = dr["DUE_DATE"] == DBNull.Value ? -1 : (Int32)dr["DUE_DATE"];
				_ALLOC_REF = dr["ALLOC_REF"] == DBNull.Value ? -1 : (Int32)dr["ALLOC_REF"];
				_ALLOC_DATE = dr["ALLOC_DATE"] == DBNull.Value ? -1 : (Int32)dr["ALLOC_DATE"];
				_ALLOC_PERIOD = dr["ALLOC_PERIOD"] == DBNull.Value ? -1 : (Int32)dr["ALLOC_PERIOD"];
				_ASSET_IND = dr["ASSET_IND"] == DBNull.Value ? "" : (String)dr["ASSET_IND"];
				_ASSET_CODE = dr["ASSET_CODE"] == DBNull.Value ? "" : (String)dr["ASSET_CODE"];
				_ASSET_SUB = dr["ASSET_SUB"] == DBNull.Value ? "" : (String)dr["ASSET_SUB"];
				_CONV_CODE = dr["CONV_CODE"] == DBNull.Value ? "" : (String)dr["CONV_CODE"];
				_CONV_RATE = dr["CONV_RATE"] == DBNull.Value ? 0 : (Decimal)dr["CONV_RATE"];
				_OTHER_AMT = dr["OTHER_AMT"] == DBNull.Value ? 0 : (Decimal)dr["OTHER_AMT"];
				_OTHER_DP = dr["OTHER_DP"] == DBNull.Value ? "" : (String)dr["OTHER_DP"];
				_CLEARDOWN = dr["CLEARDOWN"] == DBNull.Value ? "" : (String)dr["CLEARDOWN"];
				_REVERSAL = dr["REVERSAL"] == DBNull.Value ? "" : (String)dr["REVERSAL"];
				_LOSS_GAIN = dr["LOSS_GAIN"] == DBNull.Value ? "" : (String)dr["LOSS_GAIN"];
				_ROUGH_FLAG = dr["ROUGH_FLAG"] == DBNull.Value ? "" : (String)dr["ROUGH_FLAG"];
				_IN_USE_FLAG = dr["IN_USE_FLAG"] == DBNull.Value ? "" : (String)dr["IN_USE_FLAG"];
				_ANAL_T0 = dr["ANAL_T0"] == DBNull.Value ? "" : (String)dr["ANAL_T0"];
				_ANAL_T1 = dr["ANAL_T1"] == DBNull.Value ? "" : (String)dr["ANAL_T1"];
				_ANAL_T2 = dr["ANAL_T2"] == DBNull.Value ? "" : (String)dr["ANAL_T2"];
				_ANAL_T3 = dr["ANAL_T3"] == DBNull.Value ? "" : (String)dr["ANAL_T3"];
				_ANAL_T4 = dr["ANAL_T4"] == DBNull.Value ? "" : (String)dr["ANAL_T4"];
				_ANAL_T5 = dr["ANAL_T5"] == DBNull.Value ? "" : (String)dr["ANAL_T5"];
				_ANAL_T6 = dr["ANAL_T6"] == DBNull.Value ? "" : (String)dr["ANAL_T6"];
				_ANAL_T7 = dr["ANAL_T7"] == DBNull.Value ? "" : (String)dr["ANAL_T7"];
				_ANAL_T8 = dr["ANAL_T8"] == DBNull.Value ? "" : (String)dr["ANAL_T8"];
				_ANAL_T9 = dr["ANAL_T9"] == DBNull.Value ? "" : (String)dr["ANAL_T9"];
				_POSTING_DATE = dr["POSTING_DATE"] == DBNull.Value ? -1 : (Int32)dr["POSTING_DATE"];
				_ALLOC_IN_PROGRESS = dr["ALLOC_IN_PROGRESS"] == DBNull.Value ? "" : (String)dr["ALLOC_IN_PROGRESS"];
				_HOLD_REF = dr["HOLD_REF"] == DBNull.Value ? -1 : (Int32)dr["HOLD_REF"];
				_HOLD_OP_ID = dr["HOLD_OP_ID"] == DBNull.Value ? "" : (String)dr["HOLD_OP_ID"];
			}
		}
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("TblSALFLDGPRV");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn("ACCNT_CODE", typeof(String)),
				new DataColumn("PERIOD", typeof(Int32)),
				new DataColumn("TRANS_DATE", typeof(Int32)),
				new DataColumn("JRNAL_NO", typeof(Int32)),
				new DataColumn("JRNAL_LINE", typeof(Int32)),
				new DataColumn("AMOUNT", typeof(Decimal)),
				new DataColumn("D_C", typeof(String)),
				new DataColumn("ALLOCATION", typeof(String)),
				new DataColumn("JRNAL_TYPE", typeof(String)),
				new DataColumn("JRNAL_SRCE", typeof(String)),
				new DataColumn("TREFERENCE", typeof(String)),
				new DataColumn("DESCRIPTN", typeof(String)),
				new DataColumn("ENTRY_DATE", typeof(Int32)),
				new DataColumn("ENTRY_PRD", typeof(Int32)),
				new DataColumn("DUE_DATE", typeof(Int32)),
				new DataColumn("ALLOC_REF", typeof(Int32)),
				new DataColumn("ALLOC_DATE", typeof(Int32)),
				new DataColumn("ALLOC_PERIOD", typeof(Int32)),
				new DataColumn("ASSET_IND", typeof(String)),
				new DataColumn("ASSET_CODE", typeof(String)),
				new DataColumn("ASSET_SUB", typeof(String)),
				new DataColumn("CONV_CODE", typeof(String)),
				new DataColumn("CONV_RATE", typeof(Decimal)),
				new DataColumn("OTHER_AMT", typeof(Decimal)),
				new DataColumn("OTHER_DP", typeof(String)),
				new DataColumn("CLEARDOWN", typeof(String)),
				new DataColumn("REVERSAL", typeof(String)),
				new DataColumn("LOSS_GAIN", typeof(String)),
				new DataColumn("ROUGH_FLAG", typeof(String)),
				new DataColumn("IN_USE_FLAG", typeof(String)),
				new DataColumn("ANAL_T0", typeof(String)),
				new DataColumn("ANAL_T1", typeof(String)),
				new DataColumn("ANAL_T2", typeof(String)),
				new DataColumn("ANAL_T3", typeof(String)),
				new DataColumn("ANAL_T4", typeof(String)),
				new DataColumn("ANAL_T5", typeof(String)),
				new DataColumn("ANAL_T6", typeof(String)),
				new DataColumn("ANAL_T7", typeof(String)),
				new DataColumn("ANAL_T8", typeof(String)),
				new DataColumn("ANAL_T9", typeof(String)),
				new DataColumn("POSTING_DATE", typeof(Int32)),
				new DataColumn("ALLOC_IN_PROGRESS", typeof(String)),
				new DataColumn("HOLD_REF", typeof(Int32)),
				new DataColumn("HOLD_OP_ID", typeof(String))
				});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row["ACCNT_CODE"] = _ACCNT_CODE;
			row["PERIOD"] = _PERIOD;
			row["TRANS_DATE"] = _TRANS_DATE;
			row["JRNAL_NO"] = _JRNAL_NO;
			row["JRNAL_LINE"] = _JRNAL_LINE;
			row["AMOUNT"] = _AMOUNT;
			row["D_C"] = _D_C;
			row["ALLOCATION"] = _ALLOCATION;
			row["JRNAL_TYPE"] = _JRNAL_TYPE;
			row["JRNAL_SRCE"] = _JRNAL_SRCE;
			row["TREFERENCE"] = _TREFERENCE;
			row["DESCRIPTN"] = _DESCRIPTN;
			row["ENTRY_DATE"] = _ENTRY_DATE;
			row["ENTRY_PRD"] = _ENTRY_PRD;
			row["DUE_DATE"] = _DUE_DATE;
			row["ALLOC_REF"] = _ALLOC_REF;
			row["ALLOC_DATE"] = _ALLOC_DATE;
			row["ALLOC_PERIOD"] = _ALLOC_PERIOD;
			row["ASSET_IND"] = _ASSET_IND;
			row["ASSET_CODE"] = _ASSET_CODE;
			row["ASSET_SUB"] = _ASSET_SUB;
			row["CONV_CODE"] = _CONV_CODE;
			row["CONV_RATE"] = _CONV_RATE;
			row["OTHER_AMT"] = _OTHER_AMT;
			row["OTHER_DP"] = _OTHER_DP;
			row["CLEARDOWN"] = _CLEARDOWN;
			row["REVERSAL"] = _REVERSAL;
			row["LOSS_GAIN"] = _LOSS_GAIN;
			row["ROUGH_FLAG"] = _ROUGH_FLAG;
			row["IN_USE_FLAG"] = _IN_USE_FLAG;
			row["ANAL_T0"] = _ANAL_T0;
			row["ANAL_T1"] = _ANAL_T1;
			row["ANAL_T2"] = _ANAL_T2;
			row["ANAL_T3"] = _ANAL_T3;
			row["ANAL_T4"] = _ANAL_T4;
			row["ANAL_T5"] = _ANAL_T5;
			row["ANAL_T6"] = _ANAL_T6;
			row["ANAL_T7"] = _ANAL_T7;
			row["ANAL_T8"] = _ANAL_T8;
			row["ANAL_T9"] = _ANAL_T9;
			row["POSTING_DATE"] = _POSTING_DATE;
			row["ALLOC_IN_PROGRESS"] = _ALLOC_IN_PROGRESS;
			row["HOLD_REF"] = _HOLD_REF;
			row["HOLD_OP_ID"] = _HOLD_OP_ID;
			return row;
		}
        #endregion InitTable
    }
}
